home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / ABox 1.9.5 / CPlus Files / ABUFonts.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-26  |  3.1 KB  |  128 lines  |  [TEXT/MMCC]

  1. /*    
  2.     Copyright © 1991-1995 by TopSoft Inc.  All rights reserved.
  3.  
  4.     You may distribute this file under the terms of the TopSoft
  5.     Artistic License, accompanying this package.
  6.     
  7.     This file was developed by George (ty) Tempel in connection with TopSoft, Inc..
  8.     See the Modification History for more details.
  9.  
  10. Product
  11.     About Box
  12.  
  13. FILE
  14.     ABUFonts.c
  15.  
  16. NAME
  17.     ABUFonts.c, part of the ABox project source code,
  18.     responsible for mix-in handling the AboutBox Fonts stuff.
  19.  
  20. DESCRIPTION
  21.     This file contains defines for the about box modules.
  22.     
  23. DEVELOPED BY
  24.     George (ty) Tempel                ttempel@monmouth.com
  25.     All code in this file, and its associated header file was
  26.     Created by George (ty) Tempel in connection with the TopSoft, Inc.
  27.     "FilterTop" application development, except where noted.
  28.  
  29. CARETAKER - George (ty) Tempel <ttempel@monmouth.com>
  30.      Please consult this person for any changes or suggestions to this file.
  31.  
  32. MODIFICATION HISTORY
  33.  
  34.     dd mmm yy    -    xxx    -    patchxx: description of patch
  35.     14 June 94    -    ty    -    Initial Version Created
  36.     20-july-94    -    ty    -    initial version released
  37.     23-may-95    -    ty    -    changes for compatibility with the CodeWarrior CW6
  38.                             release and the associated Universal Headers from Apple:
  39.                             most methods that returned references now have "Ref" at
  40.                             the end of their methods names to prevent possible collisions
  41.                             with datatypes and classes of the same name (older versions
  42.                             of the compiler didn't have a problem with this).
  43.     25-oct-95    -    ty    -    changes for "const" usage under CW7; simplification of Boolean
  44.                             query methods
  45.  
  46. */
  47.  
  48. /*===========================================================================*/
  49.  
  50. /*======= Segmentation directives ========*/
  51.  
  52. #ifdef USE_MANUAL_SEGMENTATION
  53. #pragma segment ty
  54. #endif
  55.  
  56. /*============ Header files ==============*/
  57.     
  58. #include     "ABUFonts.h"
  59.  
  60. /*=============== Globals ================*/
  61.  
  62. /*================ CODE ==================*/
  63.  
  64.  
  65. /*=============================== ABUFonts::ABUFonts ================================*/
  66. ABUFonts::ABUFonts(void)
  67. {
  68. }    // end ABUFonts
  69.  
  70.  
  71. /*=============================== ABUFonts::~ABUFonts ================================*/
  72. ABUFonts::~ABUFonts(void)
  73. {
  74. }    // end ~ABUFonts
  75.  
  76.  
  77.  
  78. /*=============================== ABUFonts::FindFontHeight ===============================*/
  79. //
  80. //    FindFontHeight will return the calculated line height for a line of text
  81. //    (unstyled) in the window's default font.
  82. //
  83. //    The function returns a short
  84. //
  85. //
  86. //    is called by:
  87. //
  88. short    ABUFonts::FindFontHeight(void)
  89. {
  90.     FontInfo    fontInfo;
  91.     
  92.     //    begin here...
  93.     
  94.     ::GetFontInfo (&fontInfo);
  95.     return ABUFonts::FindFontHeight (&fontInfo);
  96. } // end FindFontHeight
  97.  
  98.  
  99.  
  100.  
  101. /*=============================== ABUFonts::FindFontHeight ===============================*/
  102. //
  103. //    FindFontHeight will return the calculated line height for a line of text
  104. //    (unstyled) in the window's default font.
  105. //
  106. //    The function returns a short
  107. //
  108. //
  109. //    is called by:
  110. //
  111. short    ABUFonts::FindFontHeight(FontInfo const *fontInfo)
  112. {
  113.     //    begin here...
  114.     
  115.     if (fontInfo)
  116.         return (fontInfo->ascent + fontInfo->descent + fontInfo->leading);
  117.     else
  118.         return 0;
  119.         
  120. } // end FindFontHeight
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.